<!--单选组-->
<template>
  <el-radio-group
    v-model="value"
    v-bind="extend"
    :id="'c' + columnId"
    :name="'c' + columnId"
    :size="size"
    :clearable="clearable"
  >
    <el-radio
      v-for="item in optionList"
      v-bind="extend"
      :key="'radio' + columnId + item.value"
      :label="item.value"
      :disabled="item.disabled"
    >
      {{item.label}}
    </el-radio>
  </el-radio-group>
</template>

<script>
  import { defineComponent } from 'vue'
  import { ElRadio, ElRadioGroup } from 'element-plus'
  // 引入组件需要的属性 引入表单子控件的管理类
  import { itemProps, itemController, loadController } from '../../map'

export default defineComponent({
  name: 'el-from-item-radios',
  inheritAttrs: false,
  components: {
    ElRadio, ElRadioGroup
  },
  props: {
    ...itemProps, // 基础属性
    modelValue: [Array]
  },
  emits: ['update:modelValue'],
  setup (props, context) {
    
    // 从后端获取数据
    const { loadDict } = loadController(props)
    loadDict()

    return {
      ...itemController(props, context.emit)
    }
  }
})
</script>
